home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d892.lha / Indent / source / source.lha / parse.c < prev    next >
C/C++ Source or Header  |  1993-06-11  |  18KB  |  562 lines

  1. /* Copyright (c) 1985 Sun Microsystems, Inc. Copyright (c) 1980 The Regents
  2.    of the University of California. Copyright (c) 1976 Board of Trustees of
  3.    the University of Illinois. All rights reserved.
  4.  
  5.    Redistribution and use in source and binary forms are permitted provided
  6.    that the above copyright notice and this paragraph are duplicated in all
  7.    such forms and that any documentation, advertising materials, and other
  8.    materials related to such distribution and use acknowledge that the
  9.    software was developed by the University of California, Berkeley, the
  10.    University of Illinois, Urbana, and Sun Microsystems, Inc.  The name of
  11.    either University or Sun Microsystems may not be used to endorse or
  12.    promote products derived from this software without specific prior written
  13.    permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.    IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
  15.    OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
  16.  
  17. #include "sys.h"
  18. #include "indent.h"
  19.  
  20. struct parser_state *parser_state_tos;
  21.  
  22. #define INITIAL_BUFFER_SIZE 1000
  23. #define INITIAL_STACK_SIZE 2
  24.  
  25. void
  26. init_parser ()
  27. {
  28.   parser_state_tos
  29.   = (struct parser_state *) xmalloc (sizeof (struct parser_state));
  30.  
  31.   parser_state_tos->p_stack_size = INITIAL_STACK_SIZE;
  32.   parser_state_tos->p_stack
  33.     = (enum codes *) xmalloc (INITIAL_STACK_SIZE * sizeof (enum codes));
  34.   parser_state_tos->il
  35.     = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int));
  36.   parser_state_tos->cstk
  37.     = (int *) xmalloc (INITIAL_STACK_SIZE * sizeof (int));
  38.   parser_state_tos->paren_indents = (short *) xmalloc (sizeof (short));
  39.  
  40.   /* Although these are supposed to grow if we reach the end,
  41.      I can find no place in the code which does this. */
  42.   combuf = (char *) xmalloc (INITIAL_BUFFER_SIZE);
  43.   labbuf = (char *) xmalloc (INITIAL_BUFFER_SIZE);
  44.   codebuf = (char *) xmalloc (INITIAL_BUFFER_SIZE);
  45.  
  46.   save_com.size = INITIAL_BUFFER_SIZE;
  47.   save_com.end = save_com.ptr = xmalloc (save_com.size);
  48.  
  49.   di_stack_alloc = 2;
  50.   di_stack = (int *) xmalloc (di_stack_alloc * sizeof (*di_stack));
  51.  
  52. }
  53.  
  54. void
  55. reset_parser ()
  56. {
  57.   parser_state_tos->next = 0;
  58.   parser_state_tos->tos = 0;
  59.   parser_state_tos->paren_indents_size = 1;
  60.   parser_state_tos->p_stack[0] = stmt;    /* this is the parser's stack */
  61.   parser_state_tos->last_nl = true;    /* this is true if the last thing
  62.                        scanned was a newline */
  63.   parser_state_tos->last_token = semicolon;
  64.   parser_state_tos->box_com = false;
  65.   parser_state_tos->cast_mask = 0;
  66.   parser_state_tos->noncast_mask = 0;
  67.   parser_state_tos->sizeof_mask = 0;
  68.   parser_state_tos->block_init = false;
  69.   parser_state_tos->block_init_level = 0;
  70.   parser_state_tos->col_1 = false;
  71.   parser_state_tos->com_col = 0;
  72.   parser_state_tos->dec_nest = 0;
  73.   parser_state_tos->i_l_follow = 0;
  74.   parser_state_tos->ind_level = 0;
  75.   parser_state_tos->last_u_d = false;
  76.   parser_state_tos->p_l_follow = 0;
  77.   parser_state_tos->paren_level = 0;
  78.   parser_state_tos->paren_depth = 0;
  79.   parser_state_tos->search_brace = false;
  80.   parser_state_tos->use_ff = false;
  81.   parser_state_tos->its_a_keyword = false;
  82.   parser_state_tos->sizeof_keyword = false;
  83.   parser_state_tos->dumped_decl_indent = false;
  84.   parser_state_tos->in_parameter_declaration = false;
  85.   parser_state_tos->just_saw_decl = false;
  86.   parser_state_tos->in_decl = false;
  87.   parser_state_tos->decl_on_line = false;
  88.   parser_state_tos->in_or_st = false;
  89.   parser_state_tos->bl_line = true;
  90.   parser_state_tos->want_blank = false;
  91.   parser_state_tos->in_stmt = false;
  92.   parser_state_tos->ind_stmt = false;
  93.   parser_state_tos->procname = "\0";
  94.   parser_state_tos->procname_end = "\0";
  95.   parser_state_tos->pcase = false;
  96.   parser_state_tos->dec_nest = 0;
  97.   di_stack[parser_state_tos->dec_nest] = 0;
  98.  
  99.   l_com = combuf + INITIAL_BUFFER_SIZE - 5;
  100.   l_lab = labbuf + INITIAL_BUFFER_SIZE - 5;
  101.   l_code = codebuf + INITIAL_BUFFER_SIZE - 5;
  102.   combuf[0] = codebuf[0] = labbuf[0] = ' ';
  103.   combuf[1] = codebuf[1] = labbuf[1] = '\0';
  104.  
  105.   else_if = 1;
  106.   else_or_endif = false;
  107.   s_lab = e_lab = labbuf + 1;
  108.   s_code = e_code = codebuf + 1;
  109.   s_com = e_com = combuf + 1;
  110.  
  111.   line_no = 1;
  112.   had_eof = false;
  113.   break_comma = false;
  114.   bp_save = 0;
  115.   be_save = 0;
  116.   if (tabsize <= 0)
  117.     tabsize = 1;
  118. }
  119.  
  120. /* like ++parser_state_tos->tos but checks for stack overflow and extends
  121.    stack if necessary.  */
  122.  
  123. int
  124. inc_pstack ()
  125. {
  126.   if (++parser_state_tos->tos >= parser_state_tos->p_stack_size)
  127.     {
  128.       parser_state_tos->p_stack_size *= 2;
  129.       parser_state_tos->p_stack = (enum codes *)
  130.     xrealloc ((char *) parser_state_tos->p_stack,
  131.           parser_state_tos->p_stack_size * sizeof (enum codes));
  132.       parser_state_tos->il = (int *)
  133.     xrealloc ((char *) parser_state_tos->il,
  134.           parser_state_tos->p_stack_size * sizeof (int));
  135.       parser_state_tos->cstk = (int *)
  136.     xrealloc ((char *) parser_state_tos->cstk,
  137.           parser_state_tos->p_stack_size * sizeof (int));
  138.     }
  139.   return parser_state_tos->tos;
  140. }
  141.  
  142. #ifdef DEBUG
  143. static char **debug_symbol_strings;
  144.  
  145. void
  146. debug_init ()
  147. {
  148.   int size = ((int) period + 4) * sizeof (char *);
  149.  
  150.   debug_symbol_strings = (char **) xmalloc (size);
  151.  
  152.   debug_symbol_strings[code_eof] = "code_eof";
  153.   debug_symbol_strings[newline] = "newline";
  154.   debug_symbol_strings[lparen] = "lparen";
  155.   debug_symbol_strings[rparen] = "rparen";
  156.   debug_symbol_strings[unary_op] = "unary_op";
  157.   debug_symbol_strings[binary_op] = "binary_op";
  158.   debug_symbol_strings[postop] = "postop";
  159.   debug_symbol_strings[question] = "question";
  160.   debug_symbol_strings[casestmt] = "casestmt";
  161.   debug_symbol_strings[colon] = "colon";
  162.   debug_symbol_strings[semicolon] = "semicolon";
  163.   debug_symbol_strings[lbrace] = "lbrace";
  164.   debug_symbol_strings[rbrace] = "rbrace";
  165.   debug_symbol_strings[ident] = "ident";
  166.   debug_symbol_strings[comma] = "comma";
  167.   debug_symbol_strings[comment] = "comment";
  168.   debug_symbol_strings[swstmt] = "swstmt";
  169.   debug_symbol_strings[preesc] = "preesc";
  170.   debug_symbol_strings[form_feed] = "form_feed";
  171.   debug_symbol_strings[decl] = "decl";
  172.   debug_symbol_strings[sp_paren] = "sp_paren";
  173.   debug_symbol_strings[sp_nparen] = "sp_nparen";
  174.   debug_symbol_strings[ifstmt] = "ifstmt";
  175.   debug_symbol_strings[whilestmt] = "whilestmt";
  176.   debug_symbol_strings[forstmt] = "forstmt";
  177.   debug_symbol_strings[stmt] = "stmt";
  178.   debug_symbol_strings[stmtl] = "stmtl";
  179.   debug_symbol_strings[elselit] = "elselit";
  180.   debug_symbol_strings[dolit] = "dolit";
  181.   debug_symbol_strings[dohead] = "dohead";
  182.   debug_symbol_strings[dostmt] = "dostmt";
  183.   debug_symbol_strings[ifhead] = "ifhead";
  184.   debug_symbol_strings[elsehead] = "elsehead";
  185.   debug_symbol_strings[period] = "period";
  186. }
  187.  
  188. #endif
  189.  
  190. void
  191. parse (tk)
  192.      enum codes tk;        /* the code for the construct scanned */
  193. {
  194.   int i;
  195.  
  196. #ifdef DEBUG
  197.   if (debug)
  198.     {
  199.       if (tk >= code_eof && tk <= period)
  200.     printf ("Parse: %s\n", debug_symbol_strings[tk]);
  201.       else
  202.     printf ("Parse: Unknown code: %d for %s\n",
  203.         (int) tk, token ? token : "NULL");
  204.     }
  205. #endif
  206.  
  207.   while (parser_state_tos->p_stack[parser_state_tos->tos] == ifhead
  208.      && tk != elselit)
  209.     {
  210.       /* true if we have an if without an else */
  211.  
  212.       /* apply the if(..) stmt ::= stmt reduction */
  213.       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  214.       reduce ();        /* see if this allows any reduction */
  215.     }
  216.  
  217.  
  218.   switch (tk)
  219.     {                /* go on and figure out what to do with the
  220.                    input */
  221.  
  222.     case decl:            /* scanned a declaration word */
  223.       parser_state_tos->search_brace = btype_2;
  224.       /* indicate that following brace should be on same line */
  225.       if (parser_state_tos->p_stack[parser_state_tos->tos] != decl)
  226.     {            /* only put one declaration onto stack */
  227.       break_comma = true;    /* while in declaration, newline should be
  228.                    forced after comma */
  229.       inc_pstack ();
  230.       parser_state_tos->p_stack[parser_state_tos->tos] = decl;
  231.       parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow;
  232.  
  233.       if (ljust_decl)
  234.         {            /* only do if we want left justified
  235.                    declarations */
  236.           parser_state_tos->ind_level = 0;
  237.           for (i = parser_state_tos->tos - 1; i > 0; --i)
  238.         if (parser_state_tos->p_stack[i] == decl)
  239.           /* indentation is number of declaration levels deep we are
  240.              times spaces per level */
  241.           parser_state_tos->ind_level += ind_size;
  242.           parser_state_tos->i_l_follow = parser_state_tos->ind_level;
  243.         }
  244.     }
  245.       break;
  246.  
  247.     case ifstmt:        /* scanned if (...) */
  248.       if (parser_state_tos->p_stack[parser_state_tos->tos] == elsehead
  249.       && else_if)        /* "else if ..." */
  250.     parser_state_tos->i_l_follow
  251.       = parser_state_tos->il[parser_state_tos->tos];
  252.     case dolit:        /* 'do' */
  253.     case forstmt:        /* for (...) */
  254.       inc_pstack ();
  255.       parser_state_tos->p_stack[parser_state_tos->tos] = tk;
  256.       parser_state_tos->il[parser_state_tos->tos]
  257.     = parser_state_tos->ind_level = parser_state_tos->i_l_follow;
  258.       parser_state_tos->i_l_follow += ind_size;    /* subsequent statements
  259.                            should be indented 1 */
  260.       parser_state_tos->search_brace = btype_2;
  261.       break;
  262.  
  263.     case lbrace:        /* scanned { */
  264.       break_comma = false;    /* don't break comma in an initial list */
  265.       if (parser_state_tos->p_stack[parser_state_tos->tos] == stmt
  266.       || parser_state_tos->p_stack[parser_state_tos->tos] == stmtl)
  267.     /* it is a random, isolated stmt group or a declaration */
  268.     parser_state_tos->i_l_follow += ind_size;
  269.       else if (parser_state_tos->p_stack[parser_state_tos->tos] == decl)
  270.     {
  271.       parser_state_tos->i_l_follow += ind_size;
  272.       if (parser_state_tos->last_rw == rw_struct_like
  273.           && parser_state_tos->block_init_level == 0
  274.           && parser_state_tos->last_token != rparen
  275.           && !btype_2)
  276. #if 0
  277.           && !parser_state_tos->col_1)
  278. #endif
  279.         {
  280.           parser_state_tos->ind_level += brace_indent;
  281.           parser_state_tos->i_l_follow += brace_indent;
  282.         }
  283.     }
  284.       else
  285.     {
  286.       if (s_code == e_code)
  287.         {
  288.           /* only do this if there is nothing on the line */
  289.  
  290.           parser_state_tos->ind_level -= ind_size;
  291.           /* it is a group as part of a while, for, etc. */
  292.  
  293.           /* For -bl formatting, indent by brace_indent additional spaces
  294.              e.g. if (foo == bar) { <--> brace_indent spaces (in this
  295.              example, 4) */
  296.           if (!btype_2)
  297.         {
  298.           parser_state_tos->ind_level += brace_indent;
  299.           parser_state_tos->i_l_follow += brace_indent;
  300.           if (parser_state_tos->p_stack[parser_state_tos->tos]
  301.               == swstmt)
  302.             case_ind += brace_indent;
  303.         }
  304.  
  305.           if (parser_state_tos->p_stack[parser_state_tos->tos] == swstmt
  306.           && case_indent
  307.           >= ind_size)
  308.         parser_state_tos->ind_level -= ind_size;
  309.           /* for a switch, brace should be two levels out from the code */
  310.         }
  311.     }
  312.  
  313.       inc_pstack ();
  314.       parser_state_tos->p_stack[parser_state_tos->tos] = lbrace;
  315.       parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level;
  316.       inc_pstack ();
  317.       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  318.       /* allow null stmt between braces */
  319.       parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow;
  320.       break;
  321.  
  322.     case whilestmt:        /* scanned while (...) */
  323.       if (parser_state_tos->p_stack[parser_state_tos->tos] == dohead)
  324.     {
  325.       /* it is matched with do stmt */
  326.       parser_state_tos->ind_level = parser_state_tos->i_l_follow
  327.         = parser_state_tos->il[parser_state_tos->tos];
  328.       inc_pstack ();
  329.       parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt;
  330.       parser_state_tos->il[parser_state_tos->tos]
  331.         = parser_state_tos->ind_level = parser_state_tos->i_l_follow;
  332.     }
  333.       else
  334.     {            /* it is a while loop */
  335.       inc_pstack ();
  336.       parser_state_tos->p_stack[parser_state_tos->tos] = whilestmt;
  337.       parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow;
  338.       parser_state_tos->i_l_follow += ind_size;
  339.       parser_state_tos->search_brace = btype_2;
  340.     }
  341.  
  342.       break;
  343.  
  344.     case elselit:        /* scanned an else */
  345.  
  346.       if (parser_state_tos->p_stack[parser_state_tos->tos] != ifhead)
  347.     diag (1, "Unmatched 'else'", 0, 0);
  348.       else
  349.     {
  350.       /* indentation for else should be same as for if */
  351.       parser_state_tos->ind_level
  352.         = parser_state_tos->il[parser_state_tos->tos];
  353.       /* everything following should be in 1 level */
  354.       parser_state_tos->i_l_follow = (parser_state_tos->ind_level
  355.                       + ind_size);
  356.  
  357.       parser_state_tos->p_stack[parser_state_tos->tos] = elsehead;
  358.       /* remember if with else */
  359.       parser_state_tos->search_brace = btype_2 | else_if;
  360.     }
  361.       break;
  362.  
  363.     case rbrace:        /* scanned a } */
  364.       /* stack should have <lbrace> <stmt> or <lbrace> <stmtl> */
  365.       if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == lbrace)
  366.     {
  367.       parser_state_tos->ind_level = parser_state_tos->i_l_follow
  368.         = parser_state_tos->il[--parser_state_tos->tos];
  369.       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  370.     }
  371.       else
  372.     diag (1, "Stmt nesting error.", 0, 0);
  373.       break;
  374.  
  375.     case swstmt:        /* had switch (...) */
  376.       inc_pstack ();
  377.       parser_state_tos->p_stack[parser_state_tos->tos] = swstmt;
  378.       parser_state_tos->cstk[parser_state_tos->tos] = case_ind;
  379.       /* save current case indent level */
  380.       parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->i_l_follow;
  381.       case_ind = parser_state_tos->i_l_follow + case_indent;    /* cases should be one
  382.                                    level down from
  383.                                    switch */
  384.       /* statements should be two levels in */
  385.       parser_state_tos->i_l_follow += case_indent + ind_size;
  386.  
  387.       parser_state_tos->search_brace = btype_2;
  388.       break;
  389.  
  390.     case semicolon:        /* this indicates a simple stmt */
  391.       break_comma = false;    /* turn off flag to break after commas in a
  392.                    declaration */
  393.       if (parser_state_tos->p_stack[parser_state_tos->tos] == dostmt)
  394.     {
  395.       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  396.     }
  397.       else
  398.     {
  399.       inc_pstack ();
  400.       parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  401.       parser_state_tos->il[parser_state_tos->tos]
  402.         = parser_state_tos->ind_level;
  403.     }
  404.       break;
  405.  
  406.     default:            /* this is an error */
  407.       diag (1, "Unknown code to parser", 0, 0);
  408.       return;
  409.  
  410.  
  411.     }                /* end of switch */
  412.  
  413.   reduce ();            /* see if any reduction can be done */
  414.  
  415. #ifdef DEBUG
  416.   if (debug)
  417.     {
  418.       printf ("\nParseStack [%d]:\n", (int) parser_state_tos->p_stack_size);
  419.       for (i = 1; i <= parser_state_tos->tos; ++i)
  420.     printf ("  stack[%d] =>   stack: %d   ind_level: %d\n",
  421.         (int) i, (int) parser_state_tos->p_stack[i],
  422.         (int) parser_state_tos->il[i]);
  423.       printf ("\n");
  424.     }
  425. #endif
  426.  
  427.   return;
  428. }
  429.  
  430. /* NAME: reduce
  431.  
  432. FUNCTION: Implements the reduce part of the parsing algorithm
  433.  
  434. ALGORITHM: The following reductions are done.  Reductions are repeated until
  435.    no more are possible.
  436.  
  437. Old TOS             New TOS <stmt> <stmt>         <stmtl> <stmtl> <stmt>
  438.    <stmtl> do <stmt>             dohead <dohead> <whilestmt>
  439.    <dostmt> if <stmt>             "ifstmt" switch <stmt>         <stmt>
  440.    decl <stmt>             <stmt> "ifelse" <stmt>         <stmt> for
  441.    <stmt>             <stmt> while <stmt>             <stmt>
  442.    "dostmt" while         <stmt>
  443.  
  444. On each reduction, parser_state_tos->i_l_follow (the indentation for the
  445.    following line) is set to the indentation level associated with the old
  446.    TOS.
  447.  
  448. PARAMETERS: None
  449.  
  450. RETURNS: Nothing
  451.  
  452. GLOBALS: parser_state_tos->cstk parser_state_tos->i_l_follow =
  453.    parser_state_tos->il parser_state_tos->p_stack = parser_state_tos->tos =
  454.  
  455. CALLS: None
  456.  
  457. CALLED BY: parse
  458.  
  459. HISTORY: initial coding     November 1976    D A Willcox of CAC
  460.  
  461. */
  462. /*----------------------------------------------*\
  463. |   REDUCTION PHASE                    |
  464. \*----------------------------------------------*/
  465. reduce ()
  466. {
  467.  
  468.   register int i;
  469.  
  470.   for (;;)
  471.     {                /* keep looping until there is nothing left
  472.                    to reduce */
  473.  
  474.       switch (parser_state_tos->p_stack[parser_state_tos->tos])
  475.     {
  476.  
  477.     case stmt:
  478.       switch (parser_state_tos->p_stack[parser_state_tos->tos - 1])
  479.         {
  480.  
  481.         case stmt:
  482.         case stmtl:
  483.           /* stmtl stmt or stmt stmt */
  484.           parser_state_tos->p_stack[--parser_state_tos->tos] = stmtl;
  485.           break;
  486.  
  487.         case dolit:    /* <do> <stmt> */
  488.           parser_state_tos->p_stack[--parser_state_tos->tos] = dohead;
  489.           parser_state_tos->i_l_follow
  490.         = parser_state_tos->il[parser_state_tos->tos];
  491.           break;
  492.  
  493.         case ifstmt:
  494.           /* <if> <stmt> */
  495.           parser_state_tos->p_stack[--parser_state_tos->tos] = ifhead;
  496.           for (i = parser_state_tos->tos - 1;
  497.            (parser_state_tos->p_stack[i] != stmt
  498.             && parser_state_tos->p_stack[i] != stmtl
  499.             && parser_state_tos->p_stack[i] != lbrace);
  500.            --i);
  501.           parser_state_tos->i_l_follow = parser_state_tos->il[i];
  502.           /* for the time being, we will assume that there is no else on
  503.              this if, and set the indentation level accordingly. If an
  504.              else is scanned, it will be fixed up later */
  505.           break;
  506.  
  507.         case swstmt:
  508.           /* <switch> <stmt> */
  509.           case_ind = parser_state_tos->cstk[parser_state_tos->tos - 1];
  510.  
  511.         case decl:        /* finish of a declaration */
  512.         case elsehead:
  513.           /* <<if> <stmt> else> <stmt> */
  514.         case forstmt:
  515.           /* <for> <stmt> */
  516.         case whilestmt:
  517.           /* <while> <stmt> */
  518.           parser_state_tos->p_stack[--parser_state_tos->tos] = stmt;
  519.           parser_state_tos->i_l_follow = parser_state_tos->il[parser_state_tos->tos];
  520.           break;
  521.  
  522.         default:        /* <anything else> <stmt> */
  523.           return;
  524.  
  525.         }            /* end of section for <stmt> on top of stack */
  526.       break;
  527.  
  528.     case whilestmt:    /* while (...) on top */
  529.       if (parser_state_tos->p_stack[parser_state_tos->tos - 1] == dohead)
  530.         {
  531.           /* it is termination of a do while */
  532. #if 0
  533.           parser_state_tos->p_stack[--parser_state_tos->tos] = stmt;
  534. #endif
  535.           parser_state_tos->p_stack[--parser_state_tos->tos] = dostmt;
  536.           break;
  537.         }
  538.       else
  539.         return;
  540.  
  541.     default:        /* anything else on top */
  542.       return;
  543.  
  544.     }
  545.     }
  546. }
  547.  
  548. /* This kludge is called from main.  It is just like parse(semicolon) except
  549.    that it does not clear break_comma.  Leaving break_comma alone is
  550.    necessary to make sure that "int foo(), bar()" gets formatted correctly
  551.    under -bc.  */
  552.  
  553. INLINE void
  554. parse_lparen_in_decl ()
  555. {
  556.   inc_pstack ();
  557.   parser_state_tos->p_stack[parser_state_tos->tos] = stmt;
  558.   parser_state_tos->il[parser_state_tos->tos] = parser_state_tos->ind_level;
  559.  
  560.   reduce ();
  561. }
  562.